# default combat equations -- includes all required equations
ATTACKSPEED = SPD - max(0, WEIGHT - CON)
# Double when DOUBLE_ATK is greater than opponent's DOUBLE_DEF
DOUBLE_ATK = ATTACKSPEED - 3
DOUBLE_DEF = ATTACKSPEED
HIT = SKL*2 + LCK//2
AVOID = ATTACKSPEED*2 + LCK
CRIT_HIT = SKL//2
CRIT_AVOID = LCK
DAMAGE = STR
DEFENSE = DEF
MAGIC_DAMAGE = MAG
MAGIC_DEFENSE = RES
CRIT_ADD = 0
THRACIA_CRIT = 0
CRIT_MULT = 3
RATING = (HP - 10)//2 + max(STR, MAG) + SKL + SPD + LCK//2 + DEF + RES
# Rescue when RESCUE_AID is greater than opponent's RESCUE_WEIGHT
RESCUE_AID = max(0, 15 - CON) if 'Mounted' in unit.tags else max(0, CON - 1)
RESCUE_WEIGHT = CON
# Steal when STEAL_ATK is greater than opponent's STEAL_DEF
STEAL_ATK = SPD
STEAL_DEF = SPD
HEAL = MAG
# This one's optional
SPEED_DEFENSE = SPD